<!--
  @author heguanghua
  @since 2020/05/07 09:32
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<table class="layui-hide" id="zmn-table" lay-filter="zmn-table" th:fragment="table">
    <thead >
        <tr>
            <th lay-data="{type:'checkbox', width:50, unresize:true, align:'center', fixed:'left'}"></th>
            <th lay-data="{field:'sort', width:60, unresize:true, fixed:'left', align:'center', edit:'text'}" th:if="${hasModifySort}">排序</th>
            <th lay-data="{field:'sort', width:60, unresize:true, align:'center',  fixed:'left'}" th:if="${!hasModifySort}">排序</th>
            <th lay-data="{field:'staffId', width:110, unresize:true, align:'center', fixed:'left'}">员工ID</th>
            <th lay-data="{field:'staffName', width:170, unresize:true, align:'center', fixed:'left'}">员工账号</th>
            <th lay-data="{field:'realName', width:100, unresize:true, align:'center', fixed:'left'}">真实姓名</th>
            <th lay-data="{field:'companyName', width:160, unresize:true, align:'center'}">合同公司</th>

            <th lay-data="{field:'deptName', width:160, unresize:true, align:'center'}">部门</th>
            <th lay-data="{field:'gradesType', width:100, unresize:true, align:'center'}">职级类别</th>

            <th lay-data="{field:'type', width:80, unresize:true, align:'center'}">员工类型</th>
            <th lay-data="{field:'entryTime', width:110, unresize:true, align:'center'}">入职时间</th>
            <th lay-data="{field:'becomeFormalTime', width:110, unresize:true, align:'center'}">转正时间</th>

            <th lay-data="{field:'status', width:80, unresize:true, align:'center'}">状态</th>
            <th lay-data="{field:'lastLoginTime', width:100, unresize:true, align:'center'}">最近登录</th>

            <th lay-data="{field:'createrAndCreateTime', width:230, unresize:true, align:'center'}">创建人/创建时间</th>
            <th lay-data="{field:'updaterAndUpdateTime', width:230, unresize:true, align:'center'}">修改人/修改时间</th>

            <th lay-data="{field:'操作', width:60, unresize:true, align:'center', fixed:'right'}"></th>
        </tr>
    </thead>
    <tbody>
        <tr th:each="item:${items}">
            <td></td>
            <td th:text="${item.sort}">sort</td>
            <td th:text="${item.staffId}">staffId</td>
            <td th:switch="${hasDetail}">
                <a th:lay-href="|${SYS_MCC}/staff/detail.action?staffId=${item.staffId}|" th:lay-text="员工信息" th:text="${item.staffName}" th:case="true">staffName</a>
                <th:block th:text="${item.staffName}" th:case="*"></th:block>
            </td>
            <td th:text="${item.realName}">realName</td>
            <td th:text="${item.companyName}">companyName</td>

            <td th:text="${item.deptName == null ? item.positionName:item.deptName}">deptName</td>
            <td th:text="${item.gradesType == null ? '':T(com.zmn.mcc.common.dictionary.StaffDict).getGradesTypeName(item.gradesType)}">gradesType</td>

            <td th:text="${item.type == null ? '':T(com.zmn.mcc.common.dictionary.StaffDict).getRoleTypeName(item.type)}">type</td>
            <td th:text="${T(com.zmn.common.utils.date.DateUtil).subDate(item.entryTime)}">entryTime</td>

            <td th:text="${T(com.zmn.common.utils.date.DateUtil).subDate(item.becomeFormalTime)}">becomeFormalTime</td>
            <td th:text="${item.staffStatus == null ? '':T(com.zmn.mcc.common.dictionary.StaffDict).getStatusName(item.staffStatus)}">staffStatus</td>
            <td th:text="${T(com.zmn.common.utils.date.DateUtil).subDate(item.lastLoginTime)}">lastLoginTime</td>

            <td th:text="${item.creater + '/' + T(com.zmn.common.utils.date.DateUtil).toString(item.createTime)}">createrAndCreateTime</td>
            <td th:text="${item.updater + '/' + T(com.zmn.common.utils.date.DateUtil).toString(item.updateTime)}">updaterAndUpdateTime</td>
            <td>
                <a th:id="${'operate-' + item.staffId + '-' + item.staffStatus + '-' + item.type}" th:staffName="${item.staffName}" class="layui-btn layui-btn-xs layui-btn-primary" lay-event="operate">操作</a>
            </td>
        </tr>
    </tbody>
</table>
